package com.itheima.day01_text1.service.Impl;

import com.itheima.day01_text1.mapper.UserMapper;
import com.itheima.day01_text1.domain.User;
import com.itheima.day01_text1.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: 祺诺
 * @Name; xqf
 * @Date: 2021/3/3 20:26
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public boolean save(User user) {
        User  select  = userMapper.select(user);
        if( select  == null){
            userMapper.save(user);
            return true;
        }
        return false;
    }

    @Override
    public boolean login(User user) {
        User select = userMapper.select(user);
        if( select  == null){
            return false;
        }
        return true;
    }
}
